//Design By Do Trung --- Email : trungqn19852003@yahoo.com
//Ngày Design :5/4/2011 5:00:32 PM
using System;
using System.Data;
using System.Data.SqlClient;
using System.Text;
using System.Linq;
using System.Collections.Generic;
 

	/// <summary>
	/// </summary>
	public class QuyenTruyCap_BA
	{
		public QuyenTruyCap_BA() {}
#region 'Variables And Properties'
		 private int int_IdQuyen ;
		 public int IdQuyen
			{
			 get 	
				{
					 return this.int_IdQuyen;
				}
			 set 	
				{
					int_IdQuyen=value;
				}
			}
		 private string string_TenQuyen ;
		 public string TenQuyen
			{
			 get 	
				{
					 return this.string_TenQuyen;
				}
			 set 	
				{
					string_TenQuyen=value;
				}
			}
#endregion

		/// <summary>
		/// Inserts a record into the QuyenTruyCap table.
		/// <summary>
		/// <param name="IdQuyen"></param>
		/// <param name="TenQuyen"></param>
		/// <returns></returns>
		public bool Insert(SqlConnection SqlCnn)
		{
			bool boolInsert = false ;
			QuyenTruyCap_DA clsDA_QuyenTruyCap = new QuyenTruyCap_DA();
			clsDA_QuyenTruyCap.IdQuyen=int_IdQuyen;
			clsDA_QuyenTruyCap.TenQuyen=string_TenQuyen;

			boolInsert = clsDA_QuyenTruyCap.Insert(SqlCnn);
			clsDA_QuyenTruyCap = null ;
			return boolInsert;
		}

		/// <summary>
		/// Selects a single record from the QuyenTruyCap table.
		/// <summary>
		/// <returns>DataTable</returns>
		public DataTable Select(SqlConnection SqlCnn)
		{
			QuyenTruyCap_DA clsDA_QuyenTruyCap = new QuyenTruyCap_DA();
			DataTable dt = new DataTable();
			dt=clsDA_QuyenTruyCap.Select(SqlCnn);
			clsDA_QuyenTruyCap= null ;
			return dt;
		}

		/// <summary>
		/// Selects a single record from the QuyenTruyCap table.
		/// <summary>
		/// <returns>DataTable</returns>
		public DataTable SelectPrimaryKey(SqlConnection SqlCnn)
		{
			QuyenTruyCap_DA clsDA_QuyenTruyCap = new QuyenTruyCap_DA();
			DataTable dt = new DataTable();
			clsDA_QuyenTruyCap.IdQuyen=int_IdQuyen;

			dt=clsDA_QuyenTruyCap.SelectPrimaryKey(SqlCnn);
			clsDA_QuyenTruyCap= null;
			return dt;
			}

		/// <summary>
		/// Updates a record in the QuyenTruyCap table.
		/// <summary>
		/// <param name="IdQuyen"></param>
		/// <param name="TenQuyen"></param>
		public bool Update(SqlConnection SqlCnn)
		{
			bool boolUpdate = false ;
			QuyenTruyCap_DA clsDA_QuyenTruyCap = new QuyenTruyCap_DA();
			clsDA_QuyenTruyCap.IdQuyen=int_IdQuyen;
			clsDA_QuyenTruyCap.TenQuyen=string_TenQuyen;

			boolUpdate = clsDA_QuyenTruyCap.Update(SqlCnn);
			clsDA_QuyenTruyCap = null ;
			return boolUpdate;
		}

		/// <summary>
		/// Deletes a record from the QuyenTruyCap table by a composite primary key.
		/// <summary>
		public bool Delete(SqlConnection SqlCnn)
		{
			bool boolDelete = false ;
			QuyenTruyCap_DA clsDA_QuyenTruyCap = new QuyenTruyCap_DA();
			clsDA_QuyenTruyCap.IdQuyen=int_IdQuyen;

			boolDelete = clsDA_QuyenTruyCap.Delete(SqlCnn);
			clsDA_QuyenTruyCap = null ;
			return boolDelete;
		}
	}
